Skip to content

Fix Promoted vs. regular property inconsistency with generics #4157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: 2.1.x
Choose a base branch
from

Conversation

sayuprc
Copy link
Contributor

@sayuprc sayuprc commented Jul 25, 2025

resolve phpstan/phpstan#13049

Fixed readonly for constructor promotions.


protected function getRule(): Rule
{
return new PropertyVarianceRule(new VarianceCheck());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix is great, but please put this into existing PropertyVarianceRuleTest instead of adding a new test case. Thank you.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!
I fixed in 4e32f77.

@sayuprc sayuprc requested a review from ondrejmirtes August 7, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Promoted vs. regular property inconsistency with generics
2 participants